﻿using System;
using System.Collections.Generic;
using System.Text;

namespace System
{
    public sealed class DalFactory
    {
        public  static IBaseDAL<T> CreateDAL<T>(DBType dBType) where T : BaseModel, new()
        {

            IBaseDAL<T> dataAccess;

            switch (dBType)
            {
                case (DBType.Sql):
                    dataAccess = new BaseDAL<T>();
                    break;
                case (DBType.Sql2005):
                    dataAccess = new SQL2005Dal<T>();
                    break;
                case (DBType.Oracle):
                    dataAccess = new OracleDal<T>();
                    break;
                default:
                    dataAccess = new BaseDAL<T>();
                    break;

            }

            return dataAccess;

        }
    }
}
